use super::*;

pub fn clean(ctx: &Context) -> eyre::Result<()> {
    let directory = &ctx.directory;

    for image_path in fs::read_dir(directory)? {
        let image_path = image_path?.path();
        if ctx.current_image_path == image_path {
            continue;
        }
        fs::remove_file(image_path)?;
    }

    Ok(())
}
